package com.todolist.client.event;

import com.google.gwt.event.shared.GwtEvent;
import com.todolist.client.ToDoListGridWidget;

public class DeleteProjectEvent extends GwtEvent<DeleteProjectEventHandler> {

    public static Type<DeleteProjectEventHandler> TYPE = new Type<DeleteProjectEventHandler>();

    private ToDoListGridWidget toDoListGridWidget;

    @Override
    public Type<DeleteProjectEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(DeleteProjectEventHandler deleteProjectEventHandler) {
        deleteProjectEventHandler.deleteProject(getToDoListGridWidget());
    }

    public void setToDoListGridWidget(ToDoListGridWidget toDoListGridWidget) {
        this.toDoListGridWidget = toDoListGridWidget;
    }

    public ToDoListGridWidget getToDoListGridWidget() {
        return toDoListGridWidget;
    }
}
